< previous page page_512 next page >

Page 512
Interacting with Windows
Now that you have the screen saver animation completed, you just need to add a few lines of code so that your program works properly as a screen saver. As you may know, the Screen Saver tab of the Display Properties dialog box allows you to configure and preview a screen saver. In each case, Windows sends a different command line to your program. Add the CheckCommandLine function to your form so that it acts appropriately:
Sub CheckCommandLine()
    Dim sCmdLine As String
    sCmdLine = Trim$(LCase$(Command$))

    'RUNNING AS A SCREEN SAVER
    If sCmdLine = "/s" Or sCmdLine = "" Then
        Exit Sub
    End If

    'RUNNING IN SETUP (CONFIG) MODE
    If sCmdLine = "/c" Then
        MsgBox "Config Screen Not Available"
        End
    End If

    'RUNNING IN PREVIEW MODE
    If Left$(sCmdLine, 2) = "/p" Then
        'parameter can be retrieved with Val(Mid$(sCmdLine,3))
End
    End If

End Sub
Finally, all you need to do is compile your project, change the filename extension from .EXE to .SCR, and copy the program to the Windows directory. It should then automatically show up in the list of available screen savers in the Screen Saver tab of the Display Properties dialog box.
SQL Server to Access Database Table Export Program
Large companies tend to rely on all different types of databases, ranging in scale from a mainframe all the way down to a single-user database on an employee's PC. Frequently, new applications that require access to these databases appear, creating a complex web of dependencies between them. For example, a consultant may be hired to write an application that needs to read some data from an established SQL Server database. With ODBC, you can simply allow the consultant's application to attach to the database. However, in certain situations this setup might pose a problem:
The SQL Server administrator now has to maintain additional login information for the new application.
SQL Server performance may be negatively affected by the extra application.

 
< previous page page_512 next page >